import request from '@/utils/request'

//从配置中获取业务的地址
import { baseUrlConfig } from '@/config/config'
const basePath = baseUrlConfig.businessBaseUrl



interface Order {
  column: String;
  method: String;
}
export interface PageListType {
  pageNum: number;
  pageSize: number;
  condition: {
    alarmType: String;
    terminal?: String;
    createTime?: String;
    order?: Array<Order>;
  }
}

// 巡查巡检接口
// 分页查询
export const getPatrolPage = () => {
  return request({
    url: basePath + '/pax/patrol/findMap',
    method: 'post',
  })
}

// 查询统计全部
export const getCountAllData = () => {
  return request({
    url: basePath + '/pax/patrol/countAll',
    method: 'post',
  })
}
// 已完成
export const getCountEndData = () => {
  return request({
    url: basePath + '/pax/patrol/countEnd',
    method: 'post',
  })
}
// 执行中
export const getCountDoingData = () => {
  return request({
    url: basePath + '/pax/patrol/countDoing',
    method: 'post',
  })
}

// 未开始
export const getCountReadyData = () => {
  return request({
    url: basePath + '/pax/patrol/countReady',
    method: 'post',
  })
}

// 设备维修接口
export const getFindData = (data: any) => {
  return request({
    url: basePath + 'rep/find',
    method: 'post',
    data
  })
}

// 查询所有的
export const getAllData = (queryType: number) => {
  return request({
    url: basePath + 'rep/list/all',
    method: 'post',
    params: {
      queryType
    }
  })
}

// 查询完成的
export const getComplete = (queryType: number) => {
  return request({
    url: basePath + '/rep/list/complete',
    method: 'post',
    params: {
      queryType
    }
  })
}
//分页获取数据
export const getPageData = (data: any) => {
  return request({
    url: basePath + '/rep/find/page',
    method: 'post',
    data
  })
}


// 查询执行中
export const getExecute = (queryType: number) => {
  return request({
    url: basePath + '/rep/list/execute',
    method: 'post',
    params: {
      queryType
    }
  })
}

// 查询未完成
export const getNostart = (queryType: number) => {
  return request({
    url: basePath + '/rep/list/nostart',
    method: 'post',
    params: {
      queryType
    }
  })
}
